home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / 3d_lib.zip / MNZ.C < prev    next >
C/C++ Source or Header  |  1990-12-09  |  875b  |  37 lines

  1. /* Find minimum z coordinate in face
  2.  
  3.    Copyright (c) 1988 by Gus O'Donnell
  4.  
  5.    Revision history:
  6.  
  7.    Version 1.00         February 29, 1988       As released.
  8.  
  9.    Version 1.01         March 20, 1988          Created libraries for all
  10.                                                 memory models
  11.  
  12. */
  13. #include "3d.h"
  14. #include <float.h>
  15. #include <math.h>
  16. #include <stdio.h>
  17. #include <values.h>
  18.  
  19. double  min_z (FACE this_face)
  20.  
  21. /* Find the minimum z coordinate in the face. */
  22.  
  23. {
  24.     double result;
  25.     CORNER *chandle;    /* Pointer for traversing the corner list. */
  26.  
  27.     chandle = this_face.first -> next;
  28.     result = MAXDOUBLE;
  29.     while (chandle -> next != NULL)
  30.     {
  31.         if (chandle -> this -> coord [2] < result)
  32.             result = chandle -> this -> coord [2];
  33.         chandle = chandle -> next;
  34.     }
  35.     return(result);
  36. }
  37.